﻿using Microsoft.AspNetCore.Mvc;

namespace Shop.Core.Share
{
    /// <summary>
    /// 
    /// </summary>
    public class ShopControllerBase : ControllerBase
    {
        [NonAction]
        protected ProblemDetails Problem(string msg, int code = 404)
            => new() { Status = code, Detail = msg };
            //=> new (code, msg);

        [NonAction]
        protected static AppResult Success()
            => new(200, "成功！");

        [NonAction]
        protected static AppResult<T> Success<T>(T data)
            => new(data);
    }
}
